package pers.qianyu.month_202102.date_20210207.weekly_contest_227;

import org.junit.*;

import java.util.*;

/**
 * [第 227 场周赛 第二题]
 * 5673. 移除石子的最大得分
 * https://leetcode-cn.com/problems/maximum-score-from-removing-stones/
 *
 * @author mizzle rain
 * @date 2021-02-07 10:50
 */
public class MaximumScore {
    public int maximumScore(int a, int b, int c) {
        int[] arr = {a, b, c};
        Arrays.sort(arr);
        if (arr[0] + arr[1] <= arr[2]) return arr[0] + arr[1];
        else return (a + b + c) / 2;
    }

    @Test
    public void test1() {
        int result = new MaximumScore().maximumScore(2, 4, 6);
        System.out.println("result = " + result);
    }

    @Test
    public void test2() {
        int result = new MaximumScore().maximumScore(4, 4, 6);
        System.out.println("result = " + result);
    }

    @Test
    public void test3() {
        int result = new MaximumScore().maximumScore(1, 8, 8);
        System.out.println("result = " + result);
    }
}
